#ifndef __BSP_UART_H
#define __BSP_UART_H

#include "ch32f10x.h"
#include "stdio.h"	

#define dma_size 512
extern uint8_t dma_tx_buf[dma_size];
extern uint8_t dma_rx_buf[dma_size];


/* UART Printf Definition */
#define DEBUG_UART1    1
#define DEBUG_UART2    2
#define DEBUG_UART3    3

/* DEBUG UATR Definition */
//#define DEBUG   DEBUG_UART1
#define DEBUG   DEBUG_UART2
//#define DEBUG   DEBUG_UART3

void USART1_Init(void);
void USART2_Init(void);
void USART3_Init(void);

void USART_SendByte(USART_TypeDef* USARTx, uint8_t Data);
void USART_SendStr(USART_TypeDef* USARTx, char *STR);

void USART1_SendByte(uint8_t Data);
void USART1_SendBuf(uint8_t *buf,int len);
void USART2_SendByte(uint8_t Data);
void USART2_SendBuf(uint8_t *buf,int len);
void USART3_SendByte(uint8_t Data);
void USART3_SendBuf(uint8_t *buf,int len);


void USART2_SendStr_dma(char *str);
void USART2_SendBuf_dma(uint8_t *buf,uint16_t len);



#endif
